Autoranging ammeter with fast dynamic response

ABSTRACT

An autoranging ammeter with fast dynamic response allows improved dynamic measurement of rapidly changing direct electrical currents. The ammeter utilizes a low-cost dual threshold comparator mechanism coupled with an analog-to-digital converter and digital processing to rapidly select the appropriate current shunt resistor.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the benefit of priority of U.S. provisionalapplication No. 62/713,749, filed Aug. 2, 2018, the contents of whichare herein incorporated by reference.

FIELD OF THE INVENTION

The present invention relates to test and measurement equipment forelectronic devices. The invention is equipment intended for use byhardware engineers, software engineers and electronics enthusiasts tomore accurately measure electrical current. The invention allowsimproved measurement of electrical current, especially for rapidlychanging direct currents. The autoranging ammeter 302 includes avoltmeter which enables the device to output current, voltage, power andenergy consumed by a target device under test.

BACKGROUND

The number of electronic devices that we purchase, use and control hasgrown significantly over the past decade. The power for these devicescomes from electricity, which is characterized by its voltage(potential) and current (number of flowing electrons). The electricpower being consumed is the mathematical product of voltage and current.The total electric energy consumed is the mathematical integral of thepower over time.

Measuring and accurately characterizing the power being consumed bythese devices is becoming more critical. The battery life forbattery-powered devices is strictly limited by the battery and theamount of power consumed over time. Many of these devices are optimizedto remain dormant or sleeping a majority of the time, and they consumevery little current. When the devices come awake to manage sensors,interact with the world around them and communicate with other devices,they may consume current many orders of magnitude larger than the sleepcurrent. Some devices may rapidly toggle from a sleep state to a wakestate and back again in microseconds. The present invention is a noveldevice for measuring the energy consumed by these devices with widedynamic range and rapid current changes.

Devices that measure electrical current are commonly called ammeters,and they have been in production for well over a century. The firstammeters in the 1800s were called “rehoscopes”. Ammeters are typicallyoptimized to measure either direct current or alternating current.Direct current is a current of a single positive or negative polarity.Alternating current switches from positive polarity to negativepolarity, often at a fixed, specific frequency. Ammeters typically havefixed ranges of current measurement. On the high current side, they arelimited by their design, ability to handle the current, and the amountof voltage drop that they impart on the system. On the low current side,they are limited by the noise floor and their analog sensing chain.

Ammeters with a single fixed range have limited utility. Many ammetersand other equipment including ammeters, such as multimeters, have amultitude of selectable ranges. Some ammeters have manually selectableranges, and the operator configures the instrument for the desiredrange. Ammeters that can switch their current measurement rangesautomatically based upon the actual current are called autorangingammeters.

The goal of most test equipment is to impart minimal change of thesystem they are measuring. Ammeters are inserted in the line ofelectrical current. Inevitably, the ammeters have some impedance thatimparts a voltage drop over the ammeter. According to Ohm's law,voltage=current*resistance. Existing equipment often imparts a voltagedrop that is significant for modern digital components, which use 3.3V,2.7V, 2.5V, 1.8V, 1.2V and even 0.9V supplies. Minimizing this ammetervoltage drop “glitch” during current measurements is critical for modernelectrical devices. Autoranging ammeters usually have a momentary“glitch” when switching ranges. The duration and magnitude of the“glitch” varies by measurement technology and implementation, but this“glitch” causes measurement inaccuracies.

As can be seen, there is a need for an improved autoranging ammeter thatrapidly detects when a range change is required and then switchesquickly to minimize this voltage drop for improved accuracy andprecision.

SUMMARY OF THE INVENTION

The present invention is an autoranging ammeter that can accuratelymeasure current, even when the current quickly changes by many orders ofmagnitude. The ammeter contains multiple current sense resistors thatmeasure different current ranges. The ammeter dynamically selects theappropriate current sense resistor based upon the actual current. Theammeter selects lower value current sense resistors for higher currentand higher value current sensors for lower current. Selecting theappropriate range for constant currents is trivial and is implemented bycommon multimeters. Selecting the appropriate range for rapidly changingcurrents is much more difficult. The present invention uses a novel dualcomparator solution that approximates the mathematical derivative of thecurrent increases. If both comparators become active within a fixed timeinterval, the present invention jumps current ranges to ensure accuratemeasurement while maintaining a low voltage drop across the ammeter. Ifonly the lower threshold comparator becomes active in the fixed timeinterval, then the present invention switches by a single current senseresistor range. When current decreases, the ammeter dynamically selectsbetween higher value current sensor resistors by comparing the ammeterdigital value output over time.

The autoranging ammeter also includes a voltmeter and additionalprocessing. The processing applies calibration coefficients, computespower and computes energy. The autoranging ammeter includes softwarerunning on a general-purpose computing platform that can displaycurrent, voltage, power and energy over time.

The autoranging ammeter achieves significant performance at a reducedcost compared to contemporary ammeters. The autoranging ammeter isdesigned to measure currents ranging from 10 nA up to 2 A with limitedduration current bursts up to 9 A. The autoranging ammeter is designedto measure supply voltages from 0 V to 13.2 V. The autoranging ammeter302 has a sampling frequency of 2 million samples per second and abandwidth greater than 250 kHz.

These and other features, aspects and advantages of the presentinvention will become better understood with reference to the followingdrawings, description and claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a view of a representative setup of an autoranging ammeter inuse to perform measurements;

FIG. 2 is a schematic diagram which shows the current sense resistorsand selection MOSFETs in the autoranging ammeter;

FIG. 3 is a schematic diagram shows the analog gain stage and comparatorthat amplifies the voltage from the current sense resistors;

FIG. 4 is a schematic diagram of a typical system setup using thepresent invention to measure the voltage, current, power and energy of atarget device under test;

FIG. 5 shows a block diagram of the autoranging ammeter; and

FIG. 6 shows a detailed block diagram of the autoranging ammeter.

DETAILED DESCRIPTION AND BEST MODE OF IMPLEMENTATION

The following detailed description is of the best currently contemplatedmodes of carrying out exemplary embodiments of the invention. Thedescription is not to be taken in a limiting sense, but is made merelyfor the purpose of illustrating the general principles of the invention,since the scope of the invention is best defined by the appended claims.

Broadly, embodiments of the present invention provide a system, method,and apparatus for to measure the voltage, current, power and energyconsumed by a target device under test (DUT).

As shown in FIGS. 1 and 4, a representative system employing the presentinvention includes: an autoranging ammeter 302, a power supply 402, adevice under test 303 and a host computing device, such as a personalcomputer (PC) 304. The power supply 402 can be any type of power supplyto provide a power source for the DUT 303, including a DC bench powersupply, an AC-DC power adapter and a battery.

The device under test 303 can be any device of interest, including amicrocontroller, an assembled printed circuit board, an electronicsubassembly and a simple resistor. FIG. 1 shows a device under test 303with an auxiliary 9V battery supply 301. The host PC 304 can be anycomputing device that is in communication with an output of theautoranging ammeter 302, such as a host USB connection. The host PC 304may operate under any suitable operating system, including a Microsoft®Windows PC, a Linux PC, an Apple® Macintosh and a Raspberry Pi runningLinux. One skilled in the art will recognize that the examples given for301, 303 and 304 are demonstrative only and that other combinations arepossible without affecting the scope of the present invention.

Multiple connection types are possible between the power supply 402, theautoranging ammeter 302 and the target DUT 303. By way of non-limitingexample, the connection 311 may include a banana jacks which allow for alow voltage drop across the connections. The powersource connections 311and the DUT connections 313 use a conductor of a suitable wire gaugewith banana plugs. The autoranging ammeter 302 includes configurableoptions to support other connector types. Common alternative connectortypes include BNC connectors with RG48/U coax cable, SMA connectors withRG316 coax cable, rectangular connectors with ribbon cable, rectangularcables with wire, terminal blocks with wire, and the like.

In the non-limiting embodiments shown, the autoranging ammeter 302communicates with the Host PC 304 over a USB link connection 312. Theautoranging ammeter 302 the USB link connection 312 may use a USB 2.0Bulk or a USB 2.0 isochronous mode to convey the outputs from theautoranging ammeter 302 to an input of the host PC 304. One skilled inthe art will recognize that other communication mechanisms are possible,including but not limited to USB 3.0, Ethernet and Wi-Fi. Theautoranging ammeter 302 uses off-the-shelf USB drivers including libusband WinUSB to interface with the autoranging ammeter 302.

The Host PC 304 runs software written in any suitable programminglanguage, such as Python, that is configured to communicate with theautoranging ammeter 302 and processes the data received. The softwaremay include a graphical user interface (GUI) 310 to display the outputsof the DUT 303, measured by the autoranging ammeter 302 and allow theoperator to explore the data. Exploration options may include a record,a save, a load, a zoom and a pan of the measured data. The GUI 310 maydisplay current with linear axes or logarithmic axes. Due to the widedynamic range of many target DUTs 303, logarithmic axes are often moreuseful to the operator. The GUI 310 may display numerous user selectablequantities individually or simultaneously, including current, voltage,power, energy, program counter, and logging output from the target DUT303.

As seen in reference to FIG. 5 a block diagram of the autorangingammeter 302 is shown. The autoranging ammeter 302 includes of an ammeter401 connected between an input 101 and an output 102 of the autorangingammeter 302. FIG. 6 shows further details of the ammeter 401. Avoltmeter 400 measures the voltage at the input 101 to the autorangingammeter 302. The voltmeter 400 may be configured using a high-impedanceopamp buffer, such as a MAX44250 opamp buffer, manufactured by MaximumIntegrate. An opamp divider, such as a MAX44252 with the ADS7056 ADC.

A digital field programmable gate array (FPGA) and digital sensormicrocontroller 403 processes the outputs of the ammeter 401 andvoltmeter 400. The FPGA also examines the output 102 to select theMOSFETs, which enable active current sense resistor(s). The autorangingammeter 302 may utilize an ICE5LP2K-SG48ITR50, manufactured by LatticeSemiconductor, for the sensor FPGA and an STM32F091, manufactured bySTMicroelectronics as the digital sensor microcontroller.

The digital sensor microcontroller communicates with the FPGA over aserial peripheral interface (SPI) bus. A power regulator 404 providessuitable operating voltages for the ammeter 401, the voltmeter 400 andthe FPGA and digital sensor microcontroller 403. A digital signalisolators 410 and an isolated DC-DC converter 412 allow the sensor'selectrical ground to be completely independent of the host PC 304. Theautoranging ammeter 302 may utilize a Silicon Labs Si8661 for thedigital isolator 410 and a CUI Inc. Series PDS1-S5-S9-M for the isolatedDC-DC converter 412. A digital controller FPGA 411 receives the datafrom the sensor FPGA 403 and relays the data to a controlmicrocontroller 413.

The autoranging ammeter 302 may utilize the Lattice ICE5LP2K-SG48ITR50for the controller FPGA 411 and an NXP Semiconductor LPC54608J512 as thecontrol microcontroller 413. The control microcontroller 413communicates with the host PC 304 over high-speed USB 2.0 and with thesensor microcontroller 403 over UART.

One skilled in the art will recognize that careful design is requiredfor the isolated DC-DC converter 412 and the power regulator 404. Theautoranging ammeter 302 limits the voltage across the shunt resistors to20 mV maximum. On a 14-bit ADC used by the autoranging ammeter 302, thismeans that the least significant bit (LSB) represents about 1 μV. Eventhough the opamps do offer power supply rejection, power supply noisecan easily couple into the signal path through a variety of methods.Implementing the present invention requires careful attention to analogdesign of both the analog signal path and the power regulation.

As seen in reference to FIG. 2, the autoranging ammeter 302 accuratelymeasures the current 103 flowing from an INPUT 101 to the OUTPUT 102 ofthe autoranging ammeter 302. The present invention computes the currentby passing the current through a plurality of resistors 111, 121, 131,141, 151 and 161 in a series connection, with each of the plurality ofresistors 111, 121, 131, 141, 151 and 161 having a known value, and thencomputing the voltage across the plurality of resistors. Common termsfor these resistors are “shunt resistors” and “current sense resistors”.The present invention uses two or more shunt resistors 111, 121, 131,141, 151 and 161 of different values which may be connected ordisconnected from the circuit.

In the non-limiting embodiment shown, the autoranging ammeter 302 usessix different resistors 111, 121, 131, 141, 151 and 161 with values of0.01 Ohms, 0.1, Ohms, 1 Ohm, 10 Ohms, 100 Ohms and 1000 Ohms,respectively. The autoranging ammeter 302 also utilizes a P-channelMOSFETs to connect each shunt resistor to the output 102. The P-channelMOSFETs are 112, 122, 132, 142, 152 and 162. When a MOSFET is enabled,current can flow from the INPUT, through the selected resistor, throughthe selected MOSFET and then out the OUTPUT. If the first MOSFET isenabled, then current can flow from the INPUT 101, though resistor 111,through MOSFET 112 and out the OUTPUT 102. The voltage across resistor111 in the autoranging ammeter 302 is then 0.01 Ohms*current. For a 1Ampere (A) current, the voltage would be 10 millivolts (mV).

The voltage is then measured at anode 134. Although node 134 is notdirectly connected to resistor 111, node 134 is connected throughresistor 121 and resistor 131. With careful design, the amount ofcurrent flowing through resistor 121 and resistor 131 can be very small,so that the voltage at node 134 relative to INPUT 101 is approximatelyequal to the voltage across resistor 111. Note that the voltage across111 will be negative with respect to 101 given the direction of current103.

The autoranging ammeter 302 allows for different resistance values toenable different current ranges. If MOSFET 112 is disabled and MOSFET122 is enabled, then current must flow through both resistor 111 andresistor 121. The total resistance is then 0.01 Ohms+0.1 Ohms whichtotals 0.11 Ohms. In this configuration, the voltage at node 134 is 11times more sensitive to when only MOSFET 112 is enabled. This processcan be repeated for each shunt resistor. When only MOSFET 162 isenabled, the total resistance is 1111.11 Ohms. In this configuration,the voltage at node 164 is 111111 times more sensitive to when onlyMOSFET 112 is enabled. The resistance values shown in FIG. 2 are thoseused in the autoranging ammeter 302. However, one skilled in the artwill recognize that other values may be selected to achieve the sameresult. One skilled in the art will also recognize that the MOSFETs maybe selected for the current rating of its paired sense resistor range.The P-channel MOSFETs are enabled when the gate voltage is sufficientlyless than the source voltage.

The digital logic 403 outputs signals at +3.3V which cannot directlydrive the P-channel MOSFETs. The autoranging ammeter 302 may utilizes afast MCP6562 comparators manufactured by Microchip Technology Inc,referenced to a −5V supply to drive the MOSFET gates. The digital logicsignals are divided by 2 between their output and the −5V supply usingtwo 4.7 kOhm resistors. The MCP6462 then compares the divided output tothe −1.69V reference. The result of the MCP6562 comparison then drivesthe MOSFET gate.

The autoranging ammeter 302 may use two difference voltage sense nodes,node 134 and node 164. The design would work correctly with static(constant) currents with only a single sense node 164. However, node 164has a high impedance relative to resistor 111. When MOSFET 112 isenabled, the impedance difference between the INPUT 101 to OUTPUT 102 ismuch lower than the impedance difference between resistor 111 and themeasurement node 164. This high impedance difference is susceptible toboth capacitive coupling and inductive coupling.

In practice, this coupling effect makes having a single measurement nodeprohibitive for measurement systems with dynamic currents that vary athigher frequencies. The autoranging ammeter 302 splits the measurementsense into two nodes. Measurement node 134 is used when MOSFET 112,MOSFET 122 or MOSFET 132 is enabled. Measurement node 164 is used whenMOSFET 142, MOSFET 152 or MOSFET 162 is enabled. Splitting the voltagesense node significantly reduces the coupling effect for higherprecision dynamic measurements.

The measurement voltage output connects to the voltage sense circuitryshown in FIG. 2. This section describes the voltage sense circuitry fora single measurement node. Either measurement node 134 or 164 connectsto V_(IN) 201. The operation amplifier (opamp) gain circuit 210increases the voltage measured over the shunt resistor(s) by 11. Notethat the ground is selected to be the INPUT 101, and the expected V_(IN)201 is a negative voltage. The opamp selection is critical to properoperation. The opamp must have very low leakage current into its +input, very low offset voltage and sufficient gain-bandwidth product forthe signals of interest. The input leakage current, also called inputbias current, is critical since it can allow the current to bypass theOUTPUT 102. The autoranging ammeter 302 may use the MAX4239 opamp.

A second opamp stage 220 inverts the voltage so that it becomespositive, applies an additional gain of 11, and applies a voltage offsetso that the zero current is within the dynamic response range of theanalog-to-digital converter (ADC). The selection of this opamp is lesscritical than 210 since the signal is larger and input bias currents arenot a significant concern. The present embodiment uses the MAX44252.

The present invention attempts to keep a burden voltage to a minimum.The burden voltage is the total voltage difference from INPUT 101 toOUTPUT 102. A critical aspect is rapidly decreasing the total selectedresistance when the current rapidly increases. The overflow detector 230enables rapid current increase detection.

The overflow detector 230 includes an opamp stage 231 which inverts themeasured voltage so that it is positive. The opamp output is then fed totwo comparators that form a basic derivative detector. A firstcomparator 232 detects when the sense resistor voltage exceeds themaximum target, which is 20.93 mV for the autoranging ammeter 302. Asecond comparator 233 detects when the sense resistor voltage exceeds asecond target, which is 25.00 mV for the autoranging ammeter 302. Thesetwo values along with time are used to determine changes to the selectedresistors as described below.

The autoranging ammeter 302 shares the second opamp stage 220 and theoverflow detector 230 to reduce overall product cost. Instead of fullyduplicating the voltage sense circuitry for voltage measurement node 134and voltage measurement node 164, the autoranging ammeter 302 usesanalog switches at 226 and 236 to reuse comparator 232, comparator 233and ADC 222. The autoranging ammeter 302 may use an NXP SemiconductorNX3L4357GM for the analog switches 226, 236 and a Texas InstrumentsADS7056 for the ADC 222. The analog switch 226, 236 could be insertedfurther to the left to increase component reused between channels.However, the voltage input V_(IN) is negative at 201 and after 210 whichrestricts the availability of suitable analog switches. The presentembodiment selects 226 and 236 as a reasonable design tradeoff, but oneskilled in the art the voltage sense paths could be merged at otherpoints or not merged at all without affecting the present invention.

The autoranging ammeter 302 uses the analog to digital converter output,the active shunt resistor, and calibration coefficients to compute thecurrent. The autoranging ammeter 302 is designed to be linear, so thetrivial linear transformation is:current=(ADC_output−offset)*scale

Due to the architecture of the present embodiment, the offset istypically the same for the same analog paths. The scale varies basedupon the active shunt resistor. One skilled in the art will recognizethat these calibration coefficients can be computed once based upon thedesign, computed for each device during manufacturing, and/or computedafter manufacturing. The autoranging ammeter 302 uses calibrationcoefficients computed for each device at manufacturing to eliminate theeffect of manufacturing variations. The autoranging ammeter 302 alsoallows for a recalibration service after manufacturing.

The calibration process described above is for a simple linear equation,which is suitable for the accuracy of the autoranging ammeter 302. Oneskilled in the art will recognize that the calibration process cancompensate for additional factors. Additional factors may includetemperature, nonlinearity, power supply voltage, humidity, atmosphericpressure, mechanical stress and component aging.

One skilled in the art will recognize that applying calibration tocompute current may be performed in one or more places without alteringthe present invention. The current may be computed in the sensor FPGA,the sensor microcontroller, the controller FPGA, the controllermicrocontroller and/or the Host PC. The computation of voltage, powerand energy may likewise be performed in any or all of these locations.Some features, such as a soft-fuse, may require current to be calculatedin the sensor FPGA to enable a sufficiently fast response. Since themeasured current and select is only 15 bits in width and the calculatedcurrent is common 32 bits, the raw values may be presented all the wayto the host PC to reduce communication bandwidth.

FIG. 5 shows a detailed view of the ammeter 401 in the autorangingammeter 302. The programmable sensor resistors 501 are shown in FIG. 2in more detail. An initial gain stage 502, a secondary gain stage 503,analog switches 504, an ADC 505 and comparators 506 are shown in FIG. 2in more detail. The output of the ADC 505 connects to the sensor FPGA507. The output of the comparators 506 also connects to the sensor FPGA507. The sensor FPGA 507 runs a current sense resistor selectionalgorithm that dynamically selects the appropriate resistor to match thecurrent.

The current sense resistor selection algorithm has four inputs:comparator threshold 1 (OVR1), comparator threshold 2 (OVR2), theammeter ADC value (Qv) and time. In the present embodiment, thecomparator threshold detections are binary output signals, the ammeterADC output is a 14-bit digital value, and time is represented in digitalFPGA clocks at 48 MHz The present invention uses these values and thealgorithm to limit the voltage drop across the sense resistors underdynamic conditions. The present embodiment limits the voltage drop to 20mV while also maintaining sufficient resolution for accuratemeasurement. For underflow (moving to larger value resistors and higherselect values), this algorithm relies upon the primary 14-bit ADC valueswhich measure the voltage across the selected sense resistors. However,these values are delayed by two op-amp filter delay times and the ADC's2 sample time latency. For faster overflow detection, the algorithmrelies upon two dedicated threshold comparators. The lower thresholdcomparator determines that a resistance decrease is imminent. If theupper threshold is hit within a preset time, then the current demand ofthe target device under test is increasing rapidly. The algorithm usesthis indication to perform a rapid jump shift in resistance decrease.

One skilled in the art will recognize that the same current derivativemay be computed based upon the ADC outputs. The drawback is increasedlatency between the increased current event and the detection of saidevent. In the autoranging ammeter 302, each opamp imparts a delay, andthe ADC imparts an additional 2 sample delay. Digital processing resultsin further delay. At 2 MSPS, using the ADC outputs, the total delaycould easily exceed 2 μs. In contrast, the autoranging ammeter 302 canfully respond to over-current conditions in under 1 μs.

The autoranging ammeter 302 has a 14-bit ADC which givesLSB=3.3V/2**14=0.2014 mV. Accounting for the analog gain stages, theinput maps to 1.538 μV/LSB=650.1 LSBS/mV. The autoranging ammeter 302allows for configurable underflow threshold T_POS_UND, but the defaultis 961 LSBs greater than the zero current offset value, Qk, which is1/12.5 of the target positive range of a single sense resistor. Thepresent embodiment uses sense resistors spaced by factors of 10, so afactor of 1/12.5 allows hysteresis overlap. This overlap allows a switchin range to not immediately switch back to the prior range.

The threshold algorithm in the autoranging ammeter 302 is given by thefollowing pseudo-code:

if OVR lockout end    if OVR2:       select <= saturate(select − 3),reset_counters       OVR lockout start    elif OVR1:       select <=saturate(select − 1), reset_counters       OVR lockout start    elifOVR1 & no OVR lockout:       OVR lockout start    elif sample available:      if Qv < T_NEG_OVR:       if neg_lockout == 0          select <=saturate(select − 1)          neg_lockout = 3    else:       neg_lockout+= 1    elif (T_NEG_UND + Qk) < Qv < (T_POS_UND + Qk):       ifrange_underflow_count[select + 4]:          select <= saturate(select +1), reset_counters          range_underflow_count = 0    else:      range_underflow_count += 1    else:       range_underflow_count =0

The OVR lockout is the delay between the detection of OVR1 and when adecision is made. This time duration determines the minimum currentderivative slope required to trigger a jump shift in current range. Inthe autoranging ammeter 302, OVR1 corresponds to approximately 21 mVacross the shunt resistors, and OVR2 corresponds to approximately 25 mVacross the shunt resistors. The OVR lockout is 12 clocks at 48 MHz, or250 ns. Therefore, any current change that causes the shunt resistorvoltage to increase faster than 4 mV/250 ns (16 mV/μs) will cause a jumpshift in current range.

T_NEG_OVR is the negative “overflow” value, and the present inventionuses a value of 255 for a 14-bit ADC. While the present embodiment ismeant to be a unipolar device, this value allows increasing the range(lowering the shunt resistor value) for large negative currents. Thisadditional detection maintains a low voltage drop across the device evenif the operator connects the device in the reverse polarity. Theautoranging ammeter 302 has significantly degraded dynamic performancewhile connected in the negative polarity configuration.

The “saturate” operator is used to keep the selected shunt resistorwithin the allowed range. The autoranging ammeter 302 has 6 shuntresistors plus one lower-gain op-amp option for very high currents. Theselect value must therefore be constrained to be within 0 and 6,inclusive. The “saturate” operator returns the following:

-   -   0 if value<=0    -   6 if value>=6    -   value otherwise

The range_underflow_count is a counter that enables switching to moresensitive ranges with high current shunt resistor values. Higher shuntresistors present a higher impedance between the source and the targetdevice under test. In many systems, the source and DUT have capacitance.The shunt resistance of the present invention with capacitors on eitherside forms an analog filter. As the shunt resistance increases, the timeconstant of the filter also increases. The algorithm used by the presentembodiment increases the time required to switch to higher resistancesin rough proportion to the resistance. The present embodiment uses abinary bit selection based upon the present select value plus 4, whichyields sufficient performance in many real-world cases. A foreseenimprovement could use specific time thresholds for the transition toeach sense resistor. Another foreseen improvement could dynamicallyestimate the source and DUT capacitances based upon previous shuntresistor range switching settling times and dynamically adapt the timethresholds, specifically for the source and DUT. This later improvementcould minimize the switching delay on underflow to maximum measurementresolution.

One skilled in the art will recognize that the MOSFET selection shouldbe make-before-break to present a consistent path for electrical currentto the DUT. The MOSFETs of the higher-value shunt resistors may remainselected or may be disabled without significantly affecting the grossoperation of the present invention. Each MOSFET has a gate-sourceleakage current and drain-source leakage current that must be consideredfor the optimal operation. The present embodiment uses make-before-breakand does turn off all MOSFETs except for the selected current shuntresistor to minimize gate-source leakage.

The autoranging ammeter 302 communicates between the FPGAs using foursignals: a 48 MHz clock, a chip select and two data bits: one forcurrent and one for voltage. The current ADC and voltage ADC are samplesimultaneously, and their values are sent in parallel on the data bits.The 14-bit samples are extended with two bits that encode the shuntresistor select at the time of the sample. At 2 Msps, a total of 32Mbps×2 are required, and this interface offers 48 Mbps×2.

In the autoranging ammeter 302, the Control FPGA 411 receives thesamples from the Sense FPGA 507. The Control FPGA 411 notifies theControl Microcontroller 413 when new data is available. The ControlMicrocontroller 413 reads the sample data from the Control FPGA 411 overan 8-bit memory bus, packages the sample data into USB frames, and sendsthe sample data to the Host PC 304. One skilled in the art willrecognize that other communication protocols may be used withoutaffecting the present invention.

The autoranging ammeter 302 uses P-channel MOSFETs and shunt resistorsin a “low-side” current sensing configuration. The system zero voltagereference, often called electrical “ground”, is relative to IN+. Thisconfiguration enables the autoranging ammeter 302 to turn off allMOSFETs under software control, which in turn disables current to thedevice under test. The autoranging ammeter 302 uses this feature toimplement a software-controlled fuse (soft-fuse). The soft-fuse uses thecurrent, voltage and time as inputs. The soft-fuse can trip and shut offpower to the device under test under a number of different cases. Thesimplest case is if the current exceeds a preset threshold over a presettime duration. Another is if the energy exceeds a preset threshold overa time duration. One skilled in the art will recognize that multiplethresholds of varying durations and mechanisms can be setsimultaneously. With suitable configuration, the soft-fuse can have bothhigh-current fast-trip and longer term slow-trip functionality,simultaneously. In the autoranging ammeter 302, the soft-fuse featureonly works when the source and DUT are connected with the correctpolarity, due to the parasitic body diodes in the MOSFETs that conductin the reverse current direction.

The autoranging ammeter 302 also uses a fully isolated power supply forthe sensor. This design choice eliminates ground loops and reducesmeasurement noise in the typical test system. A foreseen variation is toflip the sensor arrangement and use N-channel (rather than P-channel)MOSFETs on the negative line referenced to IN−. The potential drawbackof this approach is that it introduces variable impedance and voltagedrop across the negative supply to the DUT, which can case additionalcomplications if the DUT 303 is connected to other equipment. Anotherpotential variation is to use N-channel MOSFETs on the positive linereferenced to OUT+. The drawbacks of this approach are that the MOSFETscannot turn off due to the parasitic body diode and the OUT+ referencehas variable impedance relative to IN+ due to the shunt resistors. Thisvariation results in increased measurement noise under dynamicconditions.

Another foreseen variation is an embodiment that uses a non-isolatedsupply. Using the flipped sensor arrangement and N-channel MOSFETs onthe negative line referenced to IN− is trivial. The embodiment ofP-channel MOSFETs referenced to IN+ is also possible. The first opampstage 210 would need to take the difference between the input 101 andeither node 134 or node 164, both of which could be large positivevoltages. Since the autoranging ammeter 302 is referenced to the input101, one input is ground and another is a small negative voltage. In theforeseen non-isolated P-channel embodiment, the common solution is touse an instrumentation amplifier with suitable common mode rejection.

The remainder of the sensor other than the first opamp stage 210 and theMOSFET gate drivers could then remain the same as the autorangingammeter 302. The drawbacks are increased offset error and decreasedbandwidth. Single chip solutions, such as the Texas Instruments INA219,are designed for this high-side current sensing, but they lack thebandwidth and low-current resolution.

It should be understood, of course, that the foregoing relates toexemplary embodiments of the invention and that modifications may bemade without departing from the spirit and scope of the invention as setforth in the following claims.

What is claimed is:
 1. An autoranging ammeter for measuring anelectrical current comprising: a plurality of shunt resistors in aseries connection, a first end of the series connection attached to aninput of the autoranging ammeter; a correspondingmetal-oxide-semiconductor field-effect transistor (MOSFET) electricallyconnected between each of the plurality of shunt resistors in the seriesconnection and an output of the autoranging ammeter, the correspondingMOSFET operable to select a shunt resistor value from the plurality ofshunt resistors; at least one operational amplifier configured toamplify a shunt resistor voltage to an amplified shunt resistor voltage;an analog to digital converter connected to an output of the operationalamplifier to provide a measured voltage; a first comparator thatcompares the amplified shunt resistor voltage to a first presetthreshold voltage T1; a second comparator that compares the amplifiedshunt resistor voltage to a second preset threshold voltage T2; and adigital decision logic configured to examine an output of the firstcomparator and an output of the second comparator, to compute anapproximate electrical current time derivative using a time differencebetween each comparator detecting that the amplified shunt resistorvoltage exceeds its corresponding preset threshold voltage, and toenable the corresponding MOSFET to select a lower shunt resistor valuefrom the plurality of shunt resistors.
 2. The autoranging ammeter ofclaim 1, wherein the digital decision logic selectively enable anddisable the corresponding MOSFET to select a higher shunt resistor valuebased on the output of the analog to digital converter.
 3. Theautoranging ammeter of claim 1, further comprising: a plurality ofcascaded stages, each stage having a shunt resistor, a MOSFET, an opamp,analog to digital converter, and a first and a second comparator.
 4. Theautoranging ammeter of claim 1, further comprising: a voltmeter tomeasure a voltage supplied to a target device under test.
 5. Theautoranging ammeter of claim 3, further comprising: a power outputcomputed as current multiplied by voltage.
 6. The autoranging ammeter ofclaim 3, further comprising: an energy output computed as the integralof power over time.
 7. The autoranging ammeter of claim 1, furthercomprising a microcontroller configured to implement the digitaldecision logic.
 8. The autoranging ammeter of claim 7, wherein anammeter current is determined in the microcontroller from the measuredvoltage value.
 9. The autoranging ammeter claim 1, further comprising: afield-programmable gate array (FPGA) configured execute digital decisionlogic.
 10. The autoranging ammeter of claim 9, wherein an ammetercurrent is determined in the FPGA from the measured voltage value. 11.The autoranging ammeter of claim 1, further comprising: a host computerin communication with an output of the autoranging ammeter and anammeter current is based on the measured voltage value.
 12. Theautoranging ammeter of claim 1, further comprising: a logic controlledfuse that disables the corresponding MOSFET on an over-thresholdcondition.
 13. The autoranging ammeter of claim 12, wherein theover-threshold condition is one or more of a current threshold, avoltage threshold, a power threshold, an energy threshold and aduration.